1. Field of the Invention
The present invention relates to techniques for adjusting pixel values in an image to facilitate visual effects, such as transparency effects and fade-in/fade-out effects.
2. Related Art
Advances in semiconductor technology have led to increases in processing power which make it possible to render billions of pixels per second. As a result, visual effects in user interfaces, such as transparency effects and fade-in/fade-out effects, are becoming increasingly more common. These visual effects are typically created by adjusting pixel values within a frame. For example, if a transparency effect is desired, the alpha value (i.e., a transparency value) for each pixel is adjusted until the desired transparency level is achieved. Presently, such transparency effects are supported in hardware.
One hardware-supported technique for adjusting alpha values involves specifying an alpha value for the entire window or object. Pixel values are then adjusted based on the alpha value for the window. This technique is advantageous because the alpha value for all pixels in the window is set once for the entire window and does not need to be computed on a per-pixel basis. Unfortunately, only a limited range of visual effects can be achieved using this technique. For example, a time-varying transparency effect which moves from left to right across an image cannot be produced using this technique.
Another hardware-supported technique for adjusting alpha values involves specifying an alpha value for each pixel within a window. The benefit of this technique is that it is more flexible and can be used to produce a wider-range of visual effects than the above-described technique. Unfortunately, this technique is computationally expensive because a new alpha value must be calculated for each pixel for each frame. For example, consider a time-varying transparency effect which moves from the left edge of the frame to the right edge of the frame over a given time interval. The alpha value must be calculated for each column of pixels for each time interval. For example, at t=0, all alpha values are set to 1 (i.e., fully opaque). At t=1, the alpha values in column 1 are set to 0.95. At t=2, the alpha values in column 1 are set to 0.90 and the alpha values in column 2 is set to 0.95. At t=3, the alpha values in column 1 are set to 0.85, the alpha values in column 2 is set to 0.90, and the alpha values in column 3 are set to 0.95 (and so on).
Another problem with existing hardware techniques is that pixel operations require the in-memory pixel values to be modified. This operation can permanently change the pixel values for the frame which means that it is not possible to reverse the operation.
Hence, what is needed is a method and an apparatus for adjusting pixel values to produce visual effects in a frame to be displayed without the problems described above.